import request from '@/utils/request'

export function fetchList(query) {
  return request({
    url: '/info/article/base/list',
    method: 'get',
    params: query
  })
}

export function fetchArticle(id) {
  return request({
    url: '/info/article/' + id,
    method: 'get'
  })
}

export function createArticle(data) {
  return request({
    url: '/info/article/base',
    method: 'post',
    data
  })
}

export function updateArticle(data) {
  return request({
    url: '/info/article/base',
    method: 'put',
    data
  })
}

export function createOrUpdateArticle(data) {
  return request({
    url: '/info/article/base/save-or-update',
    method: 'post',
    data
  })
}

export function deleteArticle(id) {
  return request({
    url: '/info/article/base/' + id,
    method: 'delete'
  })
}
